package com.jckj.core.service.impl;

import com.jckj.core.annotation.CurrentDataSource;
import com.jckj.core.dao.SysLogMapper;
import com.jckj.core.db.DataSourceEnum;
import com.jckj.core.entity.SysLog;
import com.jckj.core.exception.ServiceException;
import com.jckj.core.service.SysLogService;
import com.jckj.core.util.MyUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * </p>
 *
 * @author 刘志远
 * @date 2018/1/8
 */
@Service
@Transactional(readOnly = true, rollbackFor = ServiceException.class)
public class SysLogServiceImpl implements SysLogService {

    @Autowired
    SysLogMapper sysLogMapper;

    @Override
    @CurrentDataSource(DataSourceEnum.MASTER)
    @Transactional(readOnly = false, rollbackFor = ServiceException.class)
    public void insert(SysLog log) {
        sysLogMapper.insert(log);
    }
}
